gdk: Finish conversion to in-struct GdkWindow list nodes
authorAlexander Larsson <alexl@redhat.com>
Mon, 21 Sep 2015 13:33:53 +0000 (15:33 +0200)
committerAlexander Larsson <alexl@redhat.com>
Mon, 21 Sep 2015 14:59:51 +0000 (16:59 +0200)
gdk/gdkoffscreenwindow.c
gdk/win32/gdkwindow-win32.c
gdk/x11/gdkwindow-x11.c

index 614e3f03f28dc92f279103b886b3550f249150cd..a022795db4b32923c63d2cecc64908df01cc089f 100644 (file)
@@ -195,7 +195,7 @@ gdk_offscreen_window_reparent (GdkWindow *window,
   gdk_window_hide (window);
 
   if (window->parent)
-    window->parent->children = g_list_remove (window->parent->children, window);
+    window->parent->children = g_list_remove_link (window->parent->children, &window->children_list_node);
 
   old_parent = window->parent;
   window->parent = new_parent;
@@ -203,7 +203,7 @@ gdk_offscreen_window_reparent (GdkWindow *window,
   window->y = y;
 
   if (new_parent)
-    window->parent->children = g_list_prepend (window->parent->children, window);
+    window->parent->children = g_list_concat (&window->children_list_node, window->parent->children);
 
   _gdk_synthesize_crossing_events_for_geometry_change (window);
   if (old_parent)
index 88a9478bdef36d2815902e2ac2effe090941b9fb..67519aa3d2e93d5be10831930ae2377880406c59 100644 (file)
@@ -760,7 +760,7 @@ gdk_win32_window_foreign_new_for_display (GdkDisplay      *display,
   if (!window->parent || GDK_WINDOW_TYPE (window->parent) == GDK_WINDOW_FOREIGN)
     window->parent = _gdk_root;
 
-  window->parent->children = g_list_prepend (window->parent->children, window);
+  window->parent->children = g_list_concat (&window->children_list_node, window->parent->children);
   window->parent->impl_window->native_children =
     g_list_prepend (window->parent->impl_window->native_children, window);
 
@@ -1504,10 +1504,9 @@ gdk_win32_window_reparent (GdkWindow *window,
     }
 
   if (old_parent)
-    old_parent->children =
-      g_list_remove (old_parent->children, window);
+    old_parent->children = g_list_remove_link (old_parent->children, &window->children_list_node);
 
-  parent->children = g_list_prepend (parent->children, window);
+  parent->children = g_list_concat (&window->children_list_node, parent->children);
 
   return FALSE;
 }
index 1ace677a73970a90d026c49e64bf4298f446db4e..d08cee0f89918721d083ba7bfa09c5f3894110d8 100644 (file)
@@ -1239,7 +1239,7 @@ gdk_x11_window_foreign_new_for_display (GdkDisplay *display,
   if (!win->parent || GDK_WINDOW_TYPE (win->parent) == GDK_WINDOW_FOREIGN)
     win->parent = gdk_screen_get_root_window (screen);
 
-  win->parent->children = g_list_prepend (win->parent->children, win);
+  win->parent->children = g_list_concat (&win->children_list_node, win->parent->children);
   win->parent->impl_window->native_children =
     g_list_prepend (win->parent->impl_window->native_children, win);